import request from '@/utils/request'
// 门禁管理
export default {
	// 门禁广告
	query: (data) => { // 门禁广告分页数据
		return request({
			url: '/system/access/advertising/query',
			method: 'post',
			params: data
		})
	},
	save: (data) => { //门禁广告保存
		return request({
			url: '/system/access/advertising/save',
			method: 'post',
			params: data
		})
	},
	del: (data) => { //删除门禁广告
		return request({
			url: '/system/access/advertising/del',
			method: 'post',
			params: data
		})
	},

	// 门禁设备
	loadAllXiaoQu: (data) => { //获取小区
		return request({
			url: '/system/xiaoqu/loadAllXiaoQu',
			method: 'post',
			params: data
		})
	},
	deviceQuery: (data) => { //查询所有门禁
		return request({
			url: '/system/access/device/list',
			method: 'post',
			params: data
		})
	},
	deviceSave: (data) => { //保存门禁
		return request({
			url: '/system/access/device/save',
			method: 'post',
			data: data
		})
	},
	deviceUpdate: (data) => { //更新门禁
		return request({
			url: '/system/access/device/update',
			method: 'get',
			params: data
		})
	},
	deviceDel: (data) => { //删除门禁
		return request({
			url: '/system/access/device/del',
			method: 'get',
			params: data
		})
	},
	upDevice: (data) => { //更新app
		return request({
			url: '/system/config/pushUpgradeAppVersion',
			method: 'post',
			params: data
		})
	},
	restartApp: (data) => { //重启app
		return request({
			url: '/system/access/device/restart',
			method: 'post',
			params: data
		})
	},

	// webrtc设备
	webrtcQuery: (data, isLoading = true) => { //rtc设备列表
		return request({
			url: '/system/access/webrtc/query',
			method: 'get',
			params: data,
			loading: isLoading,
		})
	},
	webrtcSave: (data) => { //rtc设备绑定
		return request({
			url: '/system/access/webrtc/save',
			method: 'post',
			params: data
		})
	},
	delDeviceWebrtc: (data) => { //rtc删除设备
		return request({
			url: '/system/access/webrtc/delDeviceWebrtc',
			method: 'post',
			params: data
		})
	},
	updateDeviceWebrtc: (data) => { //rtc更新设备
		return request({
			url: '/system/access/webrtc/updateDeviceWebrtc',
			method: 'post',
			params: data
		})
	},

	// im
	imQuery: (data, isLoading = true) => { //IM列表
		return request({
			url: '/system/access/im/query',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	
	imReg: (data, isLoading = true) => { //IM注册
		return request({
			url: '/system/access/im/registerIMUserSingle',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	
	imSave: (data, isLoading = true) => { //IM保存
		return request({
			url: '/system/access/im/save',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	// 代理商模块
	agentQuery: (data, isLoading = true) => { //代理商列表
		return request({
			url: '/system/access/agent/query',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	agentSave: (data, isLoading = true) => { //代理商保存
		return request({
			url: '/system/access/agent/save',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	agentUpdate: (data, isLoading = true) => { //代理商更新
		return request({
			url: '/system/access/agent/update',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	agentDel: (data, isLoading = true) => { //代理商删除
		return request({
			url: '/system/access/agent/del',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	getAllAgent: (data, isLoading = true) => { //获取所有代理商
		return request({
			url: '/system/access/agent/getAllAgent',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	accessMakeQuery: (data, isLoading = true) => { //获取所有门禁品牌设备类型
		return request({
			url: '/system/access/make/query',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	accessMakeSave: (data, isLoading = true) => { //保存品牌设备类型
		return request({
			url: '/system/access/make/save',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	accessMakeDel: (data, isLoading = true) => { //
		return request({
			url: '/system/access/make/del',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	accessModelQuery: (data, isLoading = true) => { //获取所有门禁设备子类型
		return request({
			url: '/system/access/model/query',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	accessModelSave: (data, isLoading = true) => { //保存设备子类型
		return request({
			url: '/system/access/model/save',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	accessModelDel: (data, isLoading = true) => { //
		return request({
			url: '/system/access/model/del',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	
}
